using System;
using CodePlex.DnD4eCampaignManager.DnD4e;
using CodePlex.DnD4eCampaignManager.DnD4e.Interfaces;
using NUnit.Framework;

namespace CodePlex.DnD4eCampaignManager.CampaignManagerTests.DnD4eTests
{
    [TestFixture]
    public class PowersTests
    {
        [Test]
        public void HasPowersAtWill()
        {
            const string atWill = "melee attack, ranged attack";
            Powers powers = new Powers { PowersAtWill = atWill };
            Assert.AreEqual(atWill, powers.PowersAtWill);
        }

        [Test]
        public void HasPowersDaily()
        {
            const string daily = "best melee attack";
            Powers powers = new Powers { PowersDaily = daily };
            Assert.AreEqual(daily, powers.PowersDaily);
        }

        [Test]
        public void HasPowersEncounter()
        {
            const string encounter = "better melee attack";
            Powers powers = new Powers { PowersEncounter = encounter };
            Assert.AreEqual(encounter, powers.PowersEncounter);
        }

        [Test]
        public void ImplementsIEquatable()
        {
            Assert.IsInstanceOfType(typeof ( IEquatable<Powers> ), new Powers());
        }

        [Test]
        public void ImplementsIMovement()
        {
            Assert.IsInstanceOfType(typeof ( IPowers ), new Powers());
        }

        [Test]
        public void IsEquatable()
        {
            Powers primaryDomainObject = new Powers { PowersDaily = "Whirlwind Attack" };
            Powers duplicateDomainObject = new Powers { PowersDaily = "Whirlwind Attack" };
            Powers differentDomainObject = new Powers { PowersDaily = "Jumping Lance Attack" };

            TestHelpers.TestEquatabilityExcludingOperators(primaryDomainObject, duplicateDomainObject, differentDomainObject);
            Assert.IsTrue(primaryDomainObject == duplicateDomainObject);
            Assert.IsTrue(primaryDomainObject != differentDomainObject);
        }
    }
}